home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Graphics Programming (2nd Edition)
/
Visual Basic Graphics Programming 2nd Edition.iso
/
OldSrc
/
CH1
/
SRC
/
FONTLIST.FRM
< prev
next >
Wrap
Text File
|
1996-05-02
|
3KB
|
127 lines
VERSION 4.00
Begin VB.Form FontListForm
Caption = "List Fonts"
ClientHeight = 4515
ClientLeft = 2115
ClientTop = 1500
ClientWidth = 4695
Height = 5205
Left = 2055
LinkTopic = "Form1"
ScaleHeight = 4515
ScaleWidth = 4695
Top = 870
Width = 4815
Begin VB.ListBox PrinterList
Height = 3930
Left = 2400
MultiSelect = 2 'Extended
Sorted = -1 'True
TabIndex = 1
Top = 480
Width = 2175
End
Begin VB.ListBox ScreenList
Height = 3930
Left = 120
MultiSelect = 2 'Extended
Sorted = -1 'True
TabIndex = 0
Top = 480
Width = 2175
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "Printer Fonts"
Height = 255
Index = 1
Left = 2400
TabIndex = 3
Top = 120
Width = 2175
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "Screen Fonts"
Height = 255
Index = 0
Left = 120
TabIndex = 2
Top = 120
Width = 2175
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
End
Attribute VB_Name = "FontListForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Dim i1 As Integer
Dim i2 As Integer
Dim tst As Integer
' Fill the lists with font names.
For i1 = 0 To Printer.FontCount - 1
PrinterList.AddItem Printer.Fonts(i1)
Next i1
For i2 = 0 To Screen.FontCount - 1
ScreenList.AddItem Screen.Fonts(i2)
Next i2
' Compare the items in the lists and
' select any that are in one list but
' missing in the other
i1 = 0
i2 = 0
Do While i1 < PrinterList.ListCount And _
i2 < ScreenList.ListCount
tst = StrComp(PrinterList.List(i1), ScreenList.List(i2))
If tst < 0 Then
' Form font < Screen font
PrinterList.Selected(i1) = True
i1 = i1 + 1
ElseIf tst = 0 Then
' They match
i1 = i1 + 1
i2 = i2 + 1
Else
' Form font > Screen font
ScreenList.Selected(i2) = True
i2 = i2 + 1
End If
Loop
Do While i1 < PrinterList.ListCount
PrinterList.Selected(i1) = True
i1 = i1 + 1
Loop
Do While i2 < ScreenList.ListCount
ScreenList.Selected(i2) = True
i2 = i2 + 1
Loop
PrinterList.TopIndex = 0
ScreenList.TopIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub mnuFileExit_Click()
Unload Me
End Sub